Using a Raspberry PI as a router

1. Installing OS

Equipment:

  • Raspberry PI model 3 B

  • Micro SD card

  • Computer

  • Monitor, keyboard and mouse


Getting/Installing the os:

  • First I downloaded the image installer from the official website: image installer

  • I installed the 64 lite Rasbian os version


The setup:

  • To configure the PI you need a monitor, mouse and keyboard.

  • You could also prepare the SSH beforehand but it’s a bit more complicated.

  • When you boot for the first time you get setup menu where you go through the basic stuff.


The OS:

  • Rasbian lite is a version of Rasbian without a desktop environment, you only get a terminal.

2. Connecting with the WIFI

Connecting:

  • Connecting the raspberry pi to a wifi network is as simple as just adding some lines to a config file.

  • The file we need to change is : etc/wpa_supplicant/wpa_supplicant.conf

  • now you just need to add this lines:

network={

ssid="You SSID Name"

psk="Your WiFI Password"

key_mgmt=WPA-PSK

}



network={
    ssid="You SSID Name"
    psk="Your WiFI Password"
    key_mgmt=WPA-PSK
}
Searching for the network:

  • you can search for al the wifi networks by typing this command:

$ sudo iwlist wlan0 scan

  • The problem with the raspberry pi is that wifi isn’t standard enabled. So we need to enable it by this command:

$ sudo rfkill unblock all



Problems with scrolling:

  • There is a bug in the newest OS at this moment that you can’t scroll in the terminal.

  • This was a problem as there were a lot of wifi networks.

  • You can easy fix this by writing the output to a file it works as simple as this:

$ [commando with output] > [filename].txt

  • Now you can just scroll through the file by using nano:

$ nano [filename].txt



Checking the connection:

  • you can check if you have an internet connection by this command: $ping [a website URL]

AARON FEYS

EURASMUS - 01

Using a Raspberry PI as a router

3. SSH

SSH:

  • SSH is a method of controlling a computer over a network.

  • It basically allows you to have a terminal on an other laptop.


Enabling SSH:

  • You can very easily enable ssh with the following command:

$ sudo raspi-config

  • Than a configuration window opens, just scroll to interfaces push enter.

  • Go to ssh push enter and enter to confirm.


Finding your IP:

  • To find your IP-address you can use this command: $ hostname -I


Connecting from an other computer:

  • As I use Ubuntu (Linux) as operating system for me its very easy with following command:

$ ssh [username]@[IP-address]

4. Making a router out of the raspberry PI

Use your raspberry PI as a router:

  • I followed this link : link

  • You need to copy a lot of commands that’s why it’s so handy to have ssh.


Wifi gone:

  • One unfortunate thing of using the raspberry pi as a router is that you can’t use the wifi anymore as internet source so you need to use a cable.

AARON FEYS

EURASMUS - 02